package logic

import (
	"context"
	"gitignore/models/mysql"

	"gitignore/gitignorerpc/gitignorerpc"
	"gitignore/gitignorerpc/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type CollectionListLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCollectionListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CollectionListLogic {
	return &CollectionListLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *CollectionListLogic) CollectionList(in *gitignorerpc.CollectionListRequest) (*gitignorerpc.CollectionListResponse, error) {
	// todo: add your logic here and delete this line
	var collect mysql.Collection

	var list []*gitignorerpc.CollectionList

	collect.FindCollectList(mysql.DB, list, in)
	return &gitignorerpc.CollectionListResponse{}, nil
}
